from selenium.webdriver.common.by import By

from base import Base
class Page(Base):
    # 点击搜索
    def sousuo(self):
        loc=(By.XPATH,'//android.widget.TextView[@text="搜索菜谱"]')
        ele=self.find_ele(loc)
        return ele
    # 输入搜索内容
    def sousuo2(self):
        loc=(By.CLASS_NAME,'android.widget.EditText')
        ele=self.find_ele(loc)
        return ele
    # 点击搜索
    def dianjisousuo(self):
        loc=(By.ANDROID_UIAUTOMATOR,'new UiSelector().text("搜索")')
        ele=self.find_ele(loc)
        return ele
    # 点击图片
    def tupian(self):
        loc=(By.XPATH,'(//android.widget.ImageView[@resource-id="com.xiachufang:id/common_photo_image_view"])[1]')
        ele=self.find_ele(loc)
        return ele
    # 点击收藏
    def soucang(self):
        loc=(By.ID,'com.xiachufang:id/recipe_bto_nav_bar_collect')
        ele=self.find_ele(loc)
        return ele
    # 断言
    def duanyan(self):
        loc=(By.ID,'com.xiachufang:id/recipe_detail_follow_btn')
        ele=self.find_ele(loc)
        return ele
    def diantang(self):
        loc=(By.ANDROID_UIAUTOMATOR,'new UiSelector().resourceId("com.xiachufang:id/tv_user_name")')
        ele=self.find_ele(loc)
        return ele
    def dubo(self):
        loc=(By.ID,'com.xiachufang:id/tv_load_status_major')
        ele=self.find_ele(loc)
        return ele